package com.runtime;

import com.base.Constant;
import com.base.Sprite;

import java.awt.Rectangle;

public abstract class Pencil extends Sprite {

    @Override
    public void move() {
        setX(getX() - 2);
        if (getX() + getWidth() <= 0) {
            Constant.gameFrame.pencilList.remove(this);
            Constant.gameFrame.isAddScore = true;
        }
    }


    public Rectangle createRectangle() {
        return new Rectangle(getX(), getY(), getWidth(), getHeight());
    }
}

